package com.liao.tensquare.admin.service;

import com.liao.tensquare.entity.Result;
import com.liao.tensquare.exception.UserInvalidException;
import com.liao.tensquare.exception.UserRegisteredException;
import com.liao.tensquare.admin.pojo.TbUser;
import com.liao.tensquare.admin.vo.UserInfoResponse;
import com.liao.tensquare.admin.vo.UserVO;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * 用户(TbUser)表服务接口
 *
 * @author long
 * @since 2021-07-16 17:00:07
 */
public interface TbUserService {

    UserInfoResponse findCurrentUserById(String userId);

    UserInfoResponse findUserById(String userId);

    void register(TbUser user) throws UserRegisteredException;

    Map<String, Object> login(Map<String, String> map) throws UserInvalidException;

    void logout(String tokenId) throws Exception;

    UserVO findByPage(int offset, int limit, Map<String, Object> columnsData, Date beginCreateDate, Date endCreateDate);

    List<UserInfoResponse> findList(String ids);

    void updateUser(TbUser tbUser);

    Result delUser(String ids);

    /**
     * 重置密码
     * @param id
     */
    void restPassword(String id);

    /**
     * 修改密码
     */
    Result updatePassword(String userId,String oldPwd,String newPwd);

}
